package com.robam.cloud.apicenter;

import com.robam.cloud.database.register.DynamicDataSourceRegister;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class //取消默认的datasource自动配置，因为我们yml配置结构变了
})
@ComponentScan(basePackages = {"com.robam"}) //扫描所有组件java类配置
@Import({DynamicDataSourceRegister.class}) //多数据源加载 不能使用Configuration 只能用ImportBeanDefinitionRegistrar方式
@EnableEurekaClient
@EnableFeignClients(basePackages = {"com.robam"}) //扫描feignClient类配置
public class ApiCenterApplication {

    public static void main(String[] args) {
        SpringApplication.run(ApiCenterApplication.class, args);
    }

}
